package com.open.loan.controller;

import java.util.HashMap;	
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import com.open.loan.utils.ResponseUtil;
import com.open.system.domain.LoanAboutUsDO;
import com.open.system.service.LoanAboutUsService;
import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping("/moblie")
public class VueAboutUsGetController {

	
	@Autowired
	private LoanAboutUsService loanAboutUsService;
	
	@ApiOperation(value="关于我们", notes="")
	@RequestMapping(value ="/getAboutUsInfo",method = RequestMethod.GET)
	public ResponseEntity<String> getAboutUsInfo(HttpServletResponse response){
					Map<String,String>mapList=new HashMap<String,String>();		
				try{
					Map<String, Object> map=new HashMap<String, Object>();
					LoanAboutUsDO aboutUsDO=new LoanAboutUsDO();
					
					List<LoanAboutUsDO>aboutUsLists=loanAboutUsService.list(map);
					for (int i = 0; i <aboutUsLists.size(); i++) {
						aboutUsDO=aboutUsLists.get(0);
						mapList.put("address",aboutUsDO.getAddress());
						mapList.put("content",aboutUsDO.getContent());
						mapList.put("phone",aboutUsDO.getPhone());
					}
				} catch (Exception e) {
					e.printStackTrace();
					ResponseUtil.toWrite("202","获取信息失败",null, response);
					return null;
				}
				ResponseUtil.toWrite("200","获取信息成功",mapList, response);
				return null;
		}
}
